<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yang-da-xiong.gitee.io","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="前言​    本篇博客围绕博主第一次学习Python语法所学的知识总结提炼而成，具体内容涉及：变量、运算符与数据类型重点知识、位运算和条件语句相关知识。">
<meta property="og:type" content="article">
<meta property="og:title" content="Python学习笔记1">
<meta property="og:url" content="https://yang-da-xiong.gitee.io/2022/01/01/Python%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B01/index.html">
<meta property="og:site_name" content="杨大熊的代码世界">
<meta property="og:description" content="前言​    本篇博客围绕博主第一次学习Python语法所学的知识总结提炼而成，具体内容涉及：变量、运算符与数据类型重点知识、位运算和条件语句相关知识。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20200914195313414.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20200914195758221.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20200914200817269.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20200914201949926.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/2020091420450448.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center">
<meta property="article:published_time" content="2022-01-01T08:33:01.996Z">
<meta property="article:modified_time" content="2022-01-02T09:25:10.395Z">
<meta property="article:author" content="杨大熊">
<meta property="article:tag" content="Python">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/20200914195313414.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center">

<link rel="canonical" href="https://yang-da-xiong.gitee.io/2022/01/01/Python%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B01/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Python学习笔记1 | 杨大熊的代码世界</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">杨大熊的代码世界</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://yang-da-xiong.gitee.io/2022/01/01/Python%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B01/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="杨大熊">
      <meta itemprop="description" content="各类IT知识分享">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="杨大熊的代码世界">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Python学习笔记1
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-01-01 16:33:01" itemprop="dateCreated datePublished" datetime="2022-01-01T16:33:01+08:00">2022-01-01</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2022-01-02 17:25:10" itemprop="dateModified" datetime="2022-01-02T17:25:10+08:00">2022-01-02</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Python%E8%AF%AD%E8%A8%80%E5%AD%A6%E4%B9%A0/" itemprop="url" rel="index"><span itemprop="name">Python语言学习</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <hr>
<h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>​    本篇博客围绕博主第一次学习Python语法所学的知识总结提炼而成，具体内容涉及：变量、运算符与数据类型重点知识、位运算和条件语句相关知识。</p>
<span id="more"></span>

<h1 id="一、变量、运算符与数据类型重点知识"><a href="#一、变量、运算符与数据类型重点知识" class="headerlink" title="一、变量、运算符与数据类型重点知识"></a>一、变量、运算符与数据类型重点知识</h1><h2 id="1-注释"><a href="#1-注释" class="headerlink" title="1.注释"></a>1.注释</h2><p>1.1 注释符： #<br>1.2 区间注释 ‘’’ ‘’’, or “”” “””</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&#x27;&#x27;&#x27;</span> </span><br><span class="line">    注释第一行 </span><br><span class="line">    注释第二行</span><br><span class="line">    注释第三行 </span><br><span class="line"><span class="string">&#x27;&#x27;&#x27;</span></span><br></pre></td></tr></table></figure>
<h2 id="2-运算符"><a href="#2-运算符" class="headerlink" title="2.运算符"></a>2.运算符</h2><p>2.1 算术运算符<br>整除 ：//<br>例如</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">a=<span class="number">3</span></span><br><span class="line">b=<span class="number">4</span></span><br><span class="line">c=a<span class="comment">//b</span></span><br><span class="line">print(c)</span><br></pre></td></tr></table></figure>
<p>结果是0<br>幂运算符 ：**</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">print(<span class="number">3</span>**<span class="number">2</span>) #<span class="number">9</span></span><br></pre></td></tr></table></figure>

<p>2.2 位运算符<br>~ 按位取反 ：如果取反后求得的数为负数，那么其实是负数的补码，需要反求原码，因此~4=-5。<br>其他的：print(4&amp;5) #4<br>print(4^5) #0001=1<br>print(4|5) #0101=5<br>2.3 其他运算符<br>is 和not is 比较的两个变量的内存地址<br>!= 和==比较的是两个变量的值</p>
<h2 id="3-数据类型与转换"><a href="#3-数据类型与转换" class="headerlink" title="3.数据类型与转换"></a>3.数据类型与转换</h2><p>3.1 dir函数返回当前参数的属性，方法列表<br>a=1031<br>print(bin(a))  #0b10000000111<br>3.2 bin函数返回一个int或long int 的二进制表示<br>3.3 对于数值变量，0, 0.0都可认为是空的<br>3.4 对于容器变量，里面没有元素就是空的<br>3.5 获取类型信息type(object)&amp;isinstance(object,classinfo)<br>print(isinstance(‘5.2’,str))  #true</p>
<h2 id="4-print-函数"><a href="#4-print-函数" class="headerlink" title="4.print 函数"></a>4.print 函数</h2><p><img src="https://img-blog.csdnimg.cn/20200914195313414.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p>
<h2 id="5-关于优先级"><a href="#5-关于优先级" class="headerlink" title="5.关于优先级"></a>5.关于优先级</h2><p>一元大于二元优先级，先算术，后移位，后位运算，最后逻辑运算。</p>
<h1 id="二、位运算"><a href="#二、位运算" class="headerlink" title="二、位运算"></a>二、位运算</h1><h2 id="1-原码、反码和补码"><a href="#1-原码、反码和补码" class="headerlink" title="1.原码、反码和补码"></a>1.原码、反码和补码</h2><p><img src="https://img-blog.csdnimg.cn/20200914195758221.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p>
<h2 id="2-按位非操作"><a href="#2-按位非操作" class="headerlink" title="2.按位非操作 ~"></a>2.按位非操作 ~</h2><h2 id="3-按位与操作-amp"><a href="#3-按位与操作-amp" class="headerlink" title="3.按位与操作 &amp;"></a>3.按位与操作 &amp;</h2><h2 id="4-按位或操作"><a href="#4-按位或操作" class="headerlink" title="4.按位或操作 |"></a>4.按位或操作 |</h2><h2 id="5-按位异或操作"><a href="#5-按位异或操作" class="headerlink" title="5.按位异或操作 ^"></a>5.按位异或操作 ^</h2><p><img src="https://img-blog.csdnimg.cn/20200914200817269.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p>
<h2 id="6-按位左移操作-lt-lt"><a href="#6-按位左移操作-lt-lt" class="headerlink" title="6.按位左移操作 &lt;&lt;"></a>6.按位左移操作 &lt;&lt;</h2><h2 id="7-按位右移操作-gt-gt"><a href="#7-按位右移操作-gt-gt" class="headerlink" title="7.按位右移操作 &gt;&gt;"></a>7.按位右移操作 &gt;&gt;</h2><h2 id="8-利用位运算实现快速计算"><a href="#8-利用位运算实现快速计算" class="headerlink" title="8.利用位运算实现快速计算"></a>8.利用位运算实现快速计算</h2><p><img src="https://img-blog.csdnimg.cn/20200914201949926.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p>
<h1 id="三、条件语句"><a href="#三、条件语句" class="headerlink" title="三、条件语句"></a>三、条件语句</h1><h2 id="1-if语句"><a href="#1-if语句" class="headerlink" title="1.if语句"></a>1.if语句</h2><h2 id="2-if-else语句"><a href="#2-if-else语句" class="headerlink" title="2.if-else语句"></a>2.if-else语句</h2><h2 id="3-if-elif-else语句"><a href="#3-if-elif-else语句" class="headerlink" title="3.if-elif-else语句"></a>3.if-elif-else语句</h2><h2 id="4-assert关键词"><a href="#4-assert关键词" class="headerlink" title="4.assert关键词"></a>4.assert关键词</h2><p>assert用来终止某些程序遇到的false情况，下面举一个例子</p>
<p><img src="https://img-blog.csdnimg.cn/2020091420450448.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc3NTcwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p>
<h1 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h1><p>通过第一次的Python学习，让我对于Python语言的变成习惯有了一定的了解，Python是一门相对于c语言来说更加人性化的语言，无论是在语法还是用法上，都更加的易于记忆和理解，相信通过坚持对Python的学习，可以使我今后在编程上积累的知识和经验更加丰富。</p>

    </div>

    
    
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>杨大熊
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://yang-da-xiong.gitee.io/2022/01/01/Python%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B01/" title="Python学习笔记1">https://yang-da-xiong.gitee.io/2022/01/01/Python学习笔记1/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Python/" rel="tag"># Python</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/12/11/%E7%AC%AC%E4%B8%80%E7%AF%87%E5%8D%9A%E5%AE%A2/" rel="prev" title="第一篇博客">
      <i class="fa fa-chevron-left"></i> 第一篇博客
    </a></div>
      <div class="post-nav-item">
    <a href="/2022/01/01/%E6%B1%87%E7%BC%96%E5%AE%9E%E9%AA%8C%E4%B9%8B%E7%BB%9F%E8%AE%A1%E5%A4%A7%E5%B0%8F%E5%86%99%E5%AD%97%E6%AF%8D/" rel="next" title="汇编小程序--统计大小写字母">
      汇编小程序--统计大小写字母 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%89%8D%E8%A8%80"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81%E5%8F%98%E9%87%8F%E3%80%81%E8%BF%90%E7%AE%97%E7%AC%A6%E4%B8%8E%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E9%87%8D%E7%82%B9%E7%9F%A5%E8%AF%86"><span class="nav-number">2.</span> <span class="nav-text">一、变量、运算符与数据类型重点知识</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E6%B3%A8%E9%87%8A"><span class="nav-number">2.1.</span> <span class="nav-text">1.注释</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E8%BF%90%E7%AE%97%E7%AC%A6"><span class="nav-number">2.2.</span> <span class="nav-text">2.运算符</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E4%B8%8E%E8%BD%AC%E6%8D%A2"><span class="nav-number">2.3.</span> <span class="nav-text">3.数据类型与转换</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-print-%E5%87%BD%E6%95%B0"><span class="nav-number">2.4.</span> <span class="nav-text">4.print 函数</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-%E5%85%B3%E4%BA%8E%E4%BC%98%E5%85%88%E7%BA%A7"><span class="nav-number">2.5.</span> <span class="nav-text">5.关于优先级</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E4%BD%8D%E8%BF%90%E7%AE%97"><span class="nav-number">3.</span> <span class="nav-text">二、位运算</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E5%8E%9F%E7%A0%81%E3%80%81%E5%8F%8D%E7%A0%81%E5%92%8C%E8%A1%A5%E7%A0%81"><span class="nav-number">3.1.</span> <span class="nav-text">1.原码、反码和补码</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E6%8C%89%E4%BD%8D%E9%9D%9E%E6%93%8D%E4%BD%9C"><span class="nav-number">3.2.</span> <span class="nav-text">2.按位非操作 ~</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E6%8C%89%E4%BD%8D%E4%B8%8E%E6%93%8D%E4%BD%9C-amp"><span class="nav-number">3.3.</span> <span class="nav-text">3.按位与操作 &amp;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E6%8C%89%E4%BD%8D%E6%88%96%E6%93%8D%E4%BD%9C"><span class="nav-number">3.4.</span> <span class="nav-text">4.按位或操作 |</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-%E6%8C%89%E4%BD%8D%E5%BC%82%E6%88%96%E6%93%8D%E4%BD%9C"><span class="nav-number">3.5.</span> <span class="nav-text">5.按位异或操作 ^</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-%E6%8C%89%E4%BD%8D%E5%B7%A6%E7%A7%BB%E6%93%8D%E4%BD%9C-lt-lt"><span class="nav-number">3.6.</span> <span class="nav-text">6.按位左移操作 &lt;&lt;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-%E6%8C%89%E4%BD%8D%E5%8F%B3%E7%A7%BB%E6%93%8D%E4%BD%9C-gt-gt"><span class="nav-number">3.7.</span> <span class="nav-text">7.按位右移操作 &gt;&gt;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8-%E5%88%A9%E7%94%A8%E4%BD%8D%E8%BF%90%E7%AE%97%E5%AE%9E%E7%8E%B0%E5%BF%AB%E9%80%9F%E8%AE%A1%E7%AE%97"><span class="nav-number">3.8.</span> <span class="nav-text">8.利用位运算实现快速计算</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%89%E3%80%81%E6%9D%A1%E4%BB%B6%E8%AF%AD%E5%8F%A5"><span class="nav-number">4.</span> <span class="nav-text">三、条件语句</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-if%E8%AF%AD%E5%8F%A5"><span class="nav-number">4.1.</span> <span class="nav-text">1.if语句</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-if-else%E8%AF%AD%E5%8F%A5"><span class="nav-number">4.2.</span> <span class="nav-text">2.if-else语句</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-if-elif-else%E8%AF%AD%E5%8F%A5"><span class="nav-number">4.3.</span> <span class="nav-text">3.if-elif-else语句</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-assert%E5%85%B3%E9%94%AE%E8%AF%8D"><span class="nav-number">4.4.</span> <span class="nav-text">4.assert关键词</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%80%BB%E7%BB%93"><span class="nav-number">5.</span> <span class="nav-text">总结</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="杨大熊"
      src="/images/avatar.png">
  <p class="site-author-name" itemprop="name">杨大熊</p>
  <div class="site-description" itemprop="description">各类IT知识分享</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">58</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">6</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">6</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/Yang-Da-xiong?tab=repositories" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;Yang-Da-xiong?tab&#x3D;repositories" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://blog.csdn.net/weixin_45775703?spm=1000.2115.3001.5343" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;weixin_45775703?spm&#x3D;1000.2115.3001.5343" rel="noopener" target="_blank"><i class="fab fa-codiepie fa-fw"></i>CSDN</a>
      </span>
  </div>
  <div class="cc-license motion-element" itemprop="license">
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" rel="noopener" target="_blank"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">杨大熊</span>
</div>

<div class="powered-by">
<i class="fa fa-user-md"></i><span id="busuanzi_container_site_uv">
  本站访客数:<span id="busuanzi_value_site_uv"></span>
</span>
</div>

<span id="busuanzi_container_site_pv">
    本站总访问量<span id="busuanzi_value_site_pv"></span>次
</span>

<div class="theme-info">
<div class="powered-by"></div>
<span class="post-count">博客全站共56.5k字</span>
</div>
        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"model":{"jsonPath":"/live2dw/assets/wanko.model.json"},"display":{"position":"right","width":150,"height":300},"mobile":{"show":true},"log":false});</script></body>
</html>

<!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/schemes/clicklove.js"></script>
